package housing.task3.dao;

import housing.task3.dto.HsRequest;
import housing.task3.dto.PK.HsRequestPk;
import housing.task3.exceptions.HsRequestDaoException;

import java.util.Date;

public interface HsRequestDao {
    /**
     * Inserts a new row in the HS_Request table.
     */
    public HsRequestPk insert(HsRequest dto) throws HsRequestDaoException;

    /**
     * Updates a single row in the HS_Request table.
     */
    public void update(HsRequestPk pk, HsRequest dto) throws HsRequestDaoException;

    /**
     * Deletes a single row in the HS_Request table.
     */
    public void delete(HsRequestPk pk) throws HsRequestDaoException;

    /**
     * Returns the rows from the HS_Request table that matches the specified primary-key value.
     */
    public HsRequest findByPrimaryKey(HsRequestPk pk) throws HsRequestDaoException;

    /**
     * Returns all rows from the HS_Request table that match the criteria 'request_id = :requestId'.
     */
    public HsRequest findByPrimaryKey(int requestId) throws HsRequestDaoException;

    /**
     * Returns all rows from the HS_Request table that match the criteria ''.
     */
    public HsRequest[] findAll() throws HsRequestDaoException;

    /**
     * Returns all rows from the HS_Request table that match the criteria 'renter_id = :renterId'.
     */
    public HsRequest[] findByHsRenter(int renterId) throws HsRequestDaoException;

    /**
     * Returns all rows from the HS_Request table that match the criteria 'workScale_id = :workscaleId'.
     */
    public HsRequest[] findByHsWorkscale(int workscaleId) throws HsRequestDaoException;

    /**
     * Returns all rows from the HS_Request table that match the criteria 'workType_id = :worktypeId'.
     */
    public HsRequest[] findByHsWorktype(int worktypeId) throws HsRequestDaoException;

    /**
     * Returns all rows from the HS_Request table that match the criteria 'request_id = :requestId'.
     */
    public HsRequest[] findWhereRequestIdEquals(int requestId) throws HsRequestDaoException;

    /**
     * Returns all rows from the HS_Request table that match the criteria 'workType_id = :worktypeId'.
     */
    public HsRequest[] findWhereWorktypeIdEquals(int worktypeId) throws HsRequestDaoException;

    /**
     * Returns all rows from the HS_Request table that match the criteria 'workScale_id = :workscaleId'.
     */
    public HsRequest[] findWhereWorkscaleIdEquals(int workscaleId) throws HsRequestDaoException;

    /**
     * Returns all rows from the HS_Request table that match the criteria 'renter_id = :renterId'.
     */
    public HsRequest[] findWhereRenterIdEquals(int renterId) throws HsRequestDaoException;

    /**
     * Returns all rows from the HS_Request table that match the criteria 'date = :date'.
     */
    public HsRequest[] findWhereDateEquals(Date date) throws HsRequestDaoException;

    /**
     * Sets the value of maxRows
     */
    public void setMaxRows(int maxRows);

    /**
     * Gets the value of maxRows
     */
    public int getMaxRows();

    /**
     * Returns all rows from the HS_Request table that match the specified arbitrary SQL statement
     */
    public HsRequest[] findByDynamicSelect(String sql, Object[] sqlParams) throws HsRequestDaoException;

    /**
     * Returns all rows from the HS_Request table that match the specified arbitrary SQL statement
     */
    public HsRequest[] findByDynamicWhere(String sql, Object[] sqlParams) throws HsRequestDaoException;

}
